<? /** @var Application_Model_Task $model */ ?>
<? $model = $this->model ?>
<div>
    <input class="input-block-level" type="hidden" value="<?= $model->getTaskId()?>" name="task-id" id="task-id">
    <label for="task-title">Заголовок:</label>
    <input class="input-block-level" type="text" value="<?= $model->getTaskTitle()?>" placeholder="Заголовок" name="task-title" id="task-title">
    <label for="task-description">Описание:</label>
    <input class="input-block-level" type="text" style="height:200px;"  value="<?= $model->getTaskDescription() ?>" placeholder="Описание" name="task-description" id="task-content">

    <div class="selects">
        <div class="selected-filter">
            <h6><i class="icon-tasks"></i>Уведомления:</h6>
            <select id="task-notify" name="task-notify">
                <? $types = Application_Model_Task::$notifies; foreach ($types as $typeId => $type) :?>
                    <option value="<?=$typeId?>" <?if ($model->getTaskNotify() == $typeId):?>selected="selected"<? endif; ?>><?= $type ?></option>
                <? endforeach;?>
            </select>
        </div>

        <div class="selected-filter">
            <h6><i class="icon-tasks"></i>Тип:</h6>
            <select id="task-type" name="task-type">
                <? $types = Application_Model_Task::$types; foreach ($types as $typeId => $type) :?>
                    <option value="<?=$typeId?>" <?if ($model->getTaskType() == $typeId):?>selected="selected"<? endif; ?>><?= $type ?></option>
                <? endforeach;?>
            </select>
        </div>

        <div class="selected-filter">
            <h6><i class="icon-tasks"></i>Вид:</h6>
            <select id="task-limit" name="task-limit">
                <? $types = Application_Model_Task::$limits; foreach ($types as $typeId => $type) :?>
                    <option value="<?=$typeId?>" <?if ($model->getTaskLimit() == $typeId):?>selected="selected"<? endif; ?>><?= $type ?></option>
                <? endforeach;?>
            </select>
        </div>

        <div class="selected-filter">
            <h6><i class="icon-tasks"></i>Приоритет:</h6>
            <select id="task-priority" name="task-type">
                <? $types = Application_Model_Task::$priorities; foreach ($types as $typeId => $type) :?>
                    <option value="<?=$typeId?>" <?if ($model->getTaskPriority() == $typeId):?>selected="selected"<? endif; ?>><?= $type ?></option>
                <? endforeach;?>
            </select>
        </div>
    </div>

    <div class="form-actions">
        <button type="submit" class="btn btn-primary" onclick="idea.saveTask();">Сохранить</button>
        <button type="button" class="btn" onclick="idea.deleteTaskForm(<?= $model->getTaskId() ?>);">Удалить</button>
    </div>
</div>
<script type="text/javascript">
    (function(){
        $('#task-content').redactor();
    }());
</script>